﻿// <copyright file="HoldingLaw.cs" company="Gravity Age Studios">
// Code released under the MIT license (see License.txt).
// </copyright>
// <author>Vicente Cartas Espinel</author>
// <email>vicente.cartas@gmail.com</email>
using LightSwitchApplication.Rules;
namespace LightSwitchApplication
{
    public partial class HoldingLaw
    {
        #region Summary

        partial void GMSummary_Compute(ref string result)
        {
            string ownerString = (this.Owner != null) ? this.Owner.Abbreviation : "None";
            string fortString = (this.FortificationLevel > 0) ? string.Format("[{0}]", this.FortificationLevel) : string.Empty;
            string effects = (this.IsContested) ? "C" : string.Empty;

            result = string.Format("{0} ({1}{2}{3})", ownerString, this.Level, fortString, effects);
        }

        partial void PublicSummary_Compute(ref string result)
        {
            string ownerString = (this.Owner != null) ? this.Owner.Abbreviation : "None";
            string fortString = (this.FortificationLevel > 0) ? string.Format("[{0}]", Utilities.MaskValue(this.FortificationLevel)) : string.Empty;
            string effects = (this.IsContested) ? "C" : string.Empty;

            result = string.Format("{0} ({1}{2}{3})", ownerString, Utilities.MaskValue(this.Level), fortString, effects);
        }

        #endregion

        #region HasInformation

        partial void HasPublicInformation_Compute(ref bool result)
        {
            result = !string.IsNullOrEmpty(this.PublicInformation);
        }

        partial void HasGMInformation_Compute(ref bool result)
        {
            result = !string.IsNullOrEmpty(this.GMInformation);
        }

        partial void HasOwnerInformation_Compute(ref bool result)
        {
            result = !string.IsNullOrEmpty(this.OwnerInformation);
        }

        #endregion
    }
}
